<template>
  <div>
    <el-breadcrumb separator-class="el-icon-arrow-right">
      <el-breadcrumb-item :to="{ path: '/index' }">首页</el-breadcrumb-item>
      <el-breadcrumb-item>企业管理</el-breadcrumb-item>
    </el-breadcrumb>
    <div class="option-box">
      <span>企业名称：<el-input size="small" style="width: 12%;" placeholder="请输入" /></span>
      <span>经营类型：<el-select v-model="type.value" size="small" placeholder="请选择" style="width: 12%">
          <el-option v-for="item in type" :key="item.value" :label="item.label" :value="item.value" />
        </el-select></span>
      <span>经营状态：<el-select v-model="busState.value" size="small" placeholder="请选择" style="width: 12%">
          <el-option v-for="item in busState" :key="item.value" :label="item.label" :value="item.value" />
        </el-select></span>
      <span>入驻状态：<el-select v-model="checkState.value" size="small" placeholder="请选择" style="width: 12%">
          <el-option v-for="item in checkState" :key="item.value" :label="item.label" :value="item.value" />
        </el-select></span>
      <span>注册来源：<el-select v-model="source.value" size="small" placeholder="请选择" style="width: 12%">
          <el-option v-for="item in source" :key="item.value" :label="item.label" :value="item.value" />
        </el-select></span>
      <br>
      <br>
      <span>营业执照认证：<el-select v-model="authentication.value" size="small" placeholder="请选择" style="width: 12%">
          <el-option v-for="item in authentication" :key="item.value" :label="item.label" :value="item.value" />
        </el-select></span>
      <span>推广员：<el-select v-model="promotion.value" size="small" placeholder="请选择" style="width: 12%">
          <el-option v-for="item in promotion" :key="item.value" :label="item.label" :value="item.value" />
        </el-select></span>
      <el-button type="primary" size="small" @click="">搜索</el-button>
      <el-button size="small" @click="">重置</el-button>
    </div>
    <hr>
    <el-table size="small" :data="tableDate" border style="width: 100%">
      <el-table-column prop="qyxx.qyxx_name" label="企业名称" width="250px" />
      <el-table-column prop="qyxx.qyxx_type" label="经营类型" width="100px"/>
      <el-table-column prop="qyxx.qyxx_jyzt" label="经营状态" width="70px"/>
      <el-table-column prop="address" label="经营执照许可证" width="120px"/>
      <el-table-column prop="address" label="注册来源" width="150px"/>
      <el-table-column prop="address" label="推广员" width="150px"/>
      <el-table-column prop="base.flow_msg" label="入驻状态" width="150px"/>
      <el-table-column prop="gwcount" label="发布岗位" width="150px"/>
      <el-table-column prop="gwtc_num" label="人才套餐余额" width="150px"/>
      <el-table-column prop="address" label="累计买套餐次数" width="150px"/>
      <el-table-column prop="base.flow_id" label="操作" width="180px">
        <template v-slot="scope">
          <el-button size="mini" type="danger" @click="qySelect(scope.$index,scope.row)">查看</el-button>
<!--          <el-button size="mini"  @click="qyDelete(scope.$index,scope.row) ">删除</el-button>-->
        </template>
      </el-table-column>
    </el-table>
<!--    <el-pagination v-model:current-page="currentPage4" v-model:page-size="pageSize4" :page-sizes="[10, 20, 30, 40]"-->
<!--      :size="size" layout="total, sizes, prev, pager, next, jumper" :total="400" @size-change="handleSizeChange"-->
<!--      @current-change="handleCurrentChange" />-->
  </div>
</template>

<script>
import { defineComponent, ref } from 'vue'
import { queryjguserlist } from '../../api/InstitutionApi'

export default defineComponent({
  name: "Management",
  data() {
    return {
      type: [
        {
          value: '养老院',
          label: '养老院'
        }, {
          value: '教育机构',
          label: '教育机构'
        },
      ],
      busState: [
        {
          value: '营业中',
          label: '营业中'
        }, {
          value: '已注销',
          label: '已注销'
        },
      ],
      checkState: [
        {
          value: '待审核',
          label: '待审核',
          style: 'color:"yellow"'
        },
        {
          value: '未通过',
          label: '未通过',
          style: 'color:"red"'
        },
        {
          value: '已入驻',
          label: '已入驻'
        },
      ],
      source: [
        {
          value: '自行申请-小程序',
          label: '自行申请-小程序'
        },
        {
          value: '推广员申请-小程序',
          label: '推广员申请-小程序'
        }
      ],
      authentication: [
        {
          value: '已认证',
          label: '已认证'
        },
        {
          value: '未认证',
          label: '未认证'
        }
      ],
      promotion: [],
      tableDate: []
    }
  },

  created() {
    this.getdata()
  },

  methods: {
    getdata(){
      queryjguserlist({}).then(res => {
        this.tableDate = res.data.data.base_info;
        console.log('企业信息：', res);
      })
    },
    qySelect(index,row) {
      // console.log('查看：',flowid)
      // 跳转页面的三种方式
      // 方式1：通过 path 跳转
      // this.$router.push({
      //   path: `/enterprises/EnEdit/:index`
      // });
      // 方式2：通过 name 跳转（推荐）
      // this.$router.push({
      //   name: 'enedit',
      //   params: { index: index }
      // });

      // 方式3：带查询参数（显示在URL中）
      this.$router.push({
        path: '/enterprises/EnEdit',
        query: { flowid: row }
      });
    },
    qyDelete(index,row){

    }

  },
})
</script>



<style scoped>
.option-box {
  margin-top: 1%;

  span {
    margin-left: 1%;
  }

  .el-button {
    width: 5%;
  }
}

.el-table {
  margin-top: 1%;
}

.el-pagination {
  margin-top: 1%;
  float: right;
}
</style>
